<template>
    <div class="goods-item" >
        <router-link to="/" class="image">
            <img v-lazy="goods.picture" alt="">
        </router-link>
        <!-- 名字 -->
        <p class="name ellipsis-2">{{goods.name}}</p>
        <!-- 描述 -->
        <p class="desc ellipsis">{{goods.desc}}</p>
        <!-- 价格 -->
        <p class="price">￥{{goods.price}}</p>
        <!-- 发现更多宝贝 -->
        <div class="extra">
            <router-link to="/">
                <span>找相似</span>
                <span>发现更多宝贝 &gt;</span>
            </router-link>
        </div>
    </div>
</template>

<script>
export default {
  props: {
    goods: {
      type: Array,
      default: () => []
    }
  }

}
</script>

<style lang="less" scoped>
.goods-item{
    width: 240px;
    height: 300px;
    padding: 10px 30px;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    transition: all .5s;
    .image{
        display: block;
        width: 160px;
        height: 160px;
        margin: 0 auto;
    }
    p{
        margin-top: 6px;
        font-size: 16px;
    }
    .name{
        height: 44px;
        color:#333;
    }
    .desc{
        color: #666;
        height: 22px;
    }
    .price{
        margin-top: 10px;
        font-size: 20px;
        color:@priceColor;
    }
    // 更多宝贝
    .extra{
        position: absolute;
        left: 0;
        bottom: 0;
        height: 86px;
        width: 100%;
        background: @themeColor;
        text-align: center;
        transition: all .5s;
        transform: translate3d(0,100%,0);
        span{
            display: block;
            color: #fff;
            width: 120px;
            margin: 0 auto;
            line-height: 30px;
            &:first-child{
                font-size: 18px;
                border-bottom: 1px solid #fff;
                margin-top: 5px;
            }
        }

    }
     &:hover{
        border-color: @themeColor;
        .extra{
            transform: none;
        }
    }
}
</style>
